<template>
	<view class="">
		<uni-popup ref="popup" type="bottom" background-color="#fff" borderRadius="20rpx 20rpx 0 0">
			<view class="popup-wrap">
				<view class="popup-content">
					<view class="goods-item">
						<view class="goods-item-image">
							<lazy-image src="/home/detail/banner.png"></lazy-image>
						</view>
						<view class="goods-item-info">
							<view class="title">
								<text>名称名称名称名称</text>
							</view>
							<view class="display-flex">
								<view class="price">
									<text>￥20.00</text>
								</view>
								<view class="old-price">
									<text>￥2000</text>
								</view>
							</view>
						</view>
					</view>
					<view class="num-item">
						<view class="num-text">
							<text>数量</text>
							<text class="tips">（限购10次）</text>
						</view>
						<service-num-input v-model="num"></service-num-input>
					</view>
				</view>
				<view class="" style="height: 300rpx;">

				</view>
				<view class="popup-bottom-btn common-btn-bg-color" @click="confirm">
					<text>确定</text>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import goodsSkuItemVue from '../goods-sku-item/goods-sku-item.vue'
	import goodsSkuItemNumVue from '../goods-sku-item/goods-sku-item-num.vue'
	export default {
		components: {
			goodsSkuItemVue,
			goodsSkuItemNumVue
		},
		props: {
			sku: {
				type: Object,
				default: {}
			}
		},
		data() {
			return {
				skuItem: 0,
				num: 1
			}
		},
		methods: {
			open() {
				this.$refs.popup.open()
			},

			close() {
				this.$refs.popup.close()
			},

			selectSkuItem(item) {
				this.skuItem = item
			},

			confirm() {
				this.$emit("confirm", this.skuItem)
				this.close()
			}
		}
	}
</script>

<style scoped lang="scss">
	.popup-wrap {
		padding: 24rpx 22rpx 68rpx 22rpx;
		box-sizing: border-box;
		// height: 946rpx;
		// position: relative;
		display: flex;
		flex-direction: column;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.popup-content {
		flex: 1;
		display: flex;
		flex-direction: column;
	}

	.popup-content-title {
		font-weight: bold;
		font-size: 34rpx;
		color: #333333;
	}

	.popup-content-list {
		height: 550rpx;
	}

	.popup-content-list-item {
		margin-top: 24rpx;
	}

	.popup-bottom-btn {
		font-weight: bold;
		font-size: 36rpx;
		color: #FFFFFF;
		height: 96rpx;
		border-radius: 80rpx;
		width: 100%;
		text-align: center;
		line-height: 93rpx;
		margin-top: 56rpx;
	}

	.goods-item {
		display: flex;
	}

	.goods-item-image {
		width: 160rpx;
		height: 160rpx;
		border-radius: 10rpx;
		overflow: hidden;
	}

	.goods-item-info {
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		margin-left: 26rpx;

		.title {
			font-weight: bold;
			font-size: 36rpx;
			color: #333333;
		}

		.price {
			font-weight: bold;
			font-size: 28rpx;
			color: #E72A2A;
		}

		.old-price {
			font-weight: 400;
			font-size: 28rpx;
			color: #999999;
			text-decoration: line-through;
			margin-left: 34rpx;
		}
	}

	.num-item {
		margin-top: 40rpx;
		display: flex;
		color: #333333;
		justify-content: space-between;
		align-items: center;

		.num-text {
			font-weight: bold;
			font-size: 32rpx;
		}

		.tips {
			font-weight: 400;
			font-size: 28rpx;
		}
	}
</style>